home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1996 November: Tool Chest / Dev.CD Nov 96 TC / Dev.CD Nov 96 TC.toast / What's New? / Development Kits / Apple Game Sprockets / NetSprocket 1.0.1 / NetSprocketTest Sources / CPlayerWindow.cp next >
Encoding:
Text File  |  1996-09-12  |  1.5 KB  |  98 lines  |  [TEXT/CWIE]

  1. #include "CPlayerWindow.h"
  2.  
  3. CPlayerWindow::CPlayerWindow()
  4. {
  5. }
  6.  
  7. CPlayerWindow::CPlayerWindow(
  8.     LStream    *inStream) : LWindow(inStream)
  9. {
  10. }
  11.  
  12. CPlayerWindow::~CPlayerWindow()
  13. {
  14. }
  15.  
  16. CPlayerWindow*
  17. CPlayerWindow::CreatePlayerWindowStream(
  18.     LStream    *inStream)
  19. {
  20.     return (new CPlayerWindow(inStream));
  21. }
  22.  
  23.  
  24. void CPlayerWindow::FinishCreateSelf(void)
  25. {
  26.     mUp = mDown = mLeft = mRight = false;
  27.     
  28.     mUpRect.top = 20;
  29.     mUpRect.bottom = 36;
  30.     mUpRect.left = 40;
  31.     mUpRect.right = 56;
  32.     
  33.     mDownRect.top = 40;
  34.     mDownRect.bottom = 56;
  35.     mDownRect.left = 40;
  36.     mDownRect.right = 56;
  37.     
  38.     mLeftRect.top = 40;
  39.     mLeftRect.bottom = 56;
  40.     mLeftRect.left = 60;
  41.     mLeftRect.right = 76;
  42.     
  43.     mRightRect.top = 40;
  44.     mRightRect.bottom = 56;
  45.     mRightRect.left = 20;
  46.     mRightRect.right = 36;
  47.     
  48.     mPulseRect.top = 5;
  49.     mPulseRect.bottom = 10;
  50.     mPulseRect.left = 5;
  51.     mPulseRect.right = 10;
  52.     
  53.     mTimeRect.top = 60;
  54.     mTimeRect.bottom = 80;
  55.     mTimeRect.left = 50;
  56.     mTimeRect.right = 150;
  57.  
  58.     TextFont(1);
  59.     TextSize(0);
  60.     
  61. }
  62.  
  63.  
  64. void CPlayerWindow::DrawSelf()
  65. {
  66.     Str255    str;
  67.     
  68.     if (mUp)
  69.         PaintRect(&mUpRect);
  70.     else
  71.         EraseRect(&mUpRect);
  72.         
  73.     if (mDown)
  74.         PaintRect(&mDownRect);
  75.     else
  76.         EraseRect(&mDownRect);
  77.  
  78.     if (mLeft)
  79.         PaintRect(&mLeftRect);
  80.     else
  81.         EraseRect(&mLeftRect);
  82.  
  83.     if (mRight)
  84.         PaintRect(&mRightRect);
  85.     else
  86.         EraseRect(&mRightRect);
  87.         
  88.     if (mPulse)
  89.         PaintRect(&mPulseRect);
  90.     else
  91.         EraseRect(&mPulseRect);
  92.         
  93.     EraseRect(&mTimeRect);
  94.     NumToString(mTransitTime, str);
  95.     
  96.     MoveTo(mTimeRect.left + 4, mTimeRect.bottom - 4);
  97.     DrawString(str);
  98. }